<include file="../Public/header" />
<script data-main="__PUBLIC__/admin/js/page/cms/article/addpic_content" src="__PUBLIC__/admin/js/lib/requirejs/require.js"></script>
</head>

<body>
  <div class="page page-addcontent">
    <div class="page-hd">
      <h1>
        <if condition="isset($res['id'])">
          修改图片内容
          <else/>添加图片内容
        </if>
      </h1>
    </div>

    <div class="form">
      <if condition="isset($res['id'])">
        <form action="{:URL('cms/Article/doEditContent')}" id="J_form" method="POST" enctype="multipart/form-data">
          <else />
          <form action="{:URL('cms/Article/doAddContent')}" id="J_form" method="POST" enctype="multipart/form-data">
      </if>
      <input type="hidden" name="jumpUrl" value="{$Think.get.jumpUrl}" />
      <input type="hidden" name="id" id="J_id" value="{$res.id}">
      <input type="hidden" name="pagesource" value="{$pagesource}">
      <input type="hidden" name="siteid" id="J_sid" value="{$res.siteid}">
      <input type="hidden" name="cid" value="{$res.cid}">
      <input type="hidden" name="classid" value="{$res.classid}">
      <dl class="kv">
        <dt>
          <label>所属栏目：</label>
        </dt>
        <dd>
          <php>
            $alist = str_replace("
            <option value='0'>全部</option>","",$alist);
          </php>
          {$alist}
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>标题：</label>
        </dt>
        <dd>
          <input class="input-text staff" type="text" name="title" value="{$res.title}" required />
          <span class="required">*</span>
          <input type="checkbox" id="J_stitle">副标题
          <div class="kv-error"></div>
          <p class="tip">您当前输入了
            <span class="word_count">0</span>个文字。</p>
        </dd>
      </dl>
      <dl class="kv J_stitle" style="display:none;">
        <dt>
          <label>副标题：</label>
        </dt>
        <dd>
          <input class="input-text J_subtitle" type="text" name="subtitle" value="{$res.subtitle}" />
          <span class="J_sword">0</span>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>标签：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="tags" value="{$res.tags}" />
          <p class="tip">当多个标签时，用空格(' ')进行分隔</p>
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>来源：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" style="width:120px;" name="source" value="{$res.source}" />&nbsp;&nbsp;&nbsp;&nbsp;作者：
          <input class="input-text" type="text" style="width:120px;" name="author" value="{$res.author}" />&nbsp;&nbsp;&nbsp;&nbsp;网编：
          <input class="input-text" type="text" style="width:120px;" name="networkcode" value="{$res.networkcode}" />
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>多图上传：</label>
        </dt>
        <dd>
          <input type="hidden" id="pic_ischange" name="pic_ischange" value="" />
          <div id="J_imageUpload">
            <volist name="pictures" id="pictures">
              <input type="text" name="imageurl[]" value="{$pictures.imageurl}" class="input-text">&nbsp;&nbsp;图片描述:
              <input type="text" name="imagedes[]" class="input-text" value="{$pictures.des}">
              <br/>
            </volist>
          </div>
          <input type="button" class="btn" value="选择文件" id="J_selectPic" />
        </dd>
      </dl>
      <dl class="kv">
        <dt>
          <label>权重：</label>
        </dt>
        <dd>
          <input class="input-text" type="number" name="weight" id="J_weight" value="{$res.weight}" />
          <div id="range-slider"></div>
        </dd>
      </dl>
      <dl isseo="Y" class="kv">
        <dt>
          <label>关键字：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="keywords" value="{$res.keywords}" />
          <input type="checkbox" id="J_smore">更多
          <p class="tip">多个关键字时，用英文逗号(,)进行分隔</p>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>文章简介：</label>
        </dt>
        <dd>
          <textarea rows="5" cols="100" name="summary">{$res.summary}</textarea>
        </dd>
      </dl>
      <dl isseo="Y" class="kv J_smore" style="display:none;">
        <dt>
          <label>文章描述：</label>
        </dt>
        <dd>
          <textarea rows="5" cols="100" name="description">{$res.description}</textarea>
        </dd>
      </dl>
      <dl isseo="Y" class="kv J_smore" style="display:none;">
        <dt>
          <label>相关节点：</label>
        </dt>
        <dd>
            <textarea name="related_node_list" rows="5" cols="100">{$res.related_node_list}</textarea>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>外部链接：</label>
        </dt>
        <dd>
          <input class="input-text" type="text" name="url" value="{$res.url}" />
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>相关文章：</label>
        </dt>
        <dd>
          <input class="btn" type="button" id="select_related_articles" data-url="{:URL('cms/Article/contentlistdialog',array('siteid'=>$res['siteid']))}" value="选择文章" />
          <div id="related_articles_div">
            <volist name="related_articles_div" id="ard">
              <php>$rat = explode("_",$ard);</php>
              <p id="related_articles_{$rat[0]}">
                <input type="hidden" name="related_articles[]" value="{$ard}" />
                <a href="{:URL('cms/Article/preview',array('id'=>$rat[0]))}" target="_blank" class="ico_top">{$rat[1]}</a>&nbsp;&nbsp;
                <a href="javascript:;" id="J_relatedRemove" data-aid="{$rat[0]}" class="ico_top">取消</a>
                <br/>
              </p>
            </volist>
          </div>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>设置区块：</label>
        </dt>
        <dd>
          <input class="btn" type="button" id="select_block_articles" value="选择区块" />
          <div id="block_articles_div">
            <volist name="block_articles_div" id="block">
              <p id="block_articles_{$block['id']}">
                <input type="hidden" name="block_articles[]" value="{$block['id']}" />
                <label>{$block['name']}</label>
                <a href="javascript:;" id="J_blockRemove" data-aid="{$block['id']}" class="ico_top">取消</a>
                <br/>
              </p>
            </volist>
          </div>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>内容属性：</label>
        </dt>
        <dd>
          <label>
            <input type="checkbox" <eq name="res.is_recommend" value="1">checked</eq> name="is_recommend" id="is_recommend" value="1"/>推荐
          </label>
          <label>
            <input type="checkbox" <eq name="res.is_hot" value="1">checked</eq> name="is_hot" id="is_hot" value="1"/>热点
          </label>
          <label>
            <input type="checkbox" <eq name="res.is_color" value="1">checked</eq> name="is_color" id="is_color" value="1"/>醒目
          </label>
          <label>
            <input type="checkbox" <eq name="res.is_top" value="1">checked</eq> name="is_top" id="is_top" value="1"/>置顶
          </label>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>是否评论：</label>
        </dt>
        <dd>
          <label>
            <input type="radio" <eq name="res.iscomment" value="1">checked</eq> name="iscomment" id="status" value="1" checked />是
          </label>
          <label>
            <input type="radio" <eq name="res.iscomment" value="0">checked</eq> name="iscomment" id="status" value="0" />否</label>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>是否转载：</label>
        </dt>
        <dd>
          <label>
            <input type="radio" <eq name="res.istransfer" value="1">checked</eq> name="istransfer" value="1"/>是</label>
          <label>
            <input type="radio" <neq name="res.istransfer" value="1">checked</neq> name="istransfer" value="0"/>否</label>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>状态：</label>
        </dt>
        <dd>
          <label>
            <input type="radio" <eq name="res.status" value="1">checked</eq>
            <eq name="res.status" value="">checked</eq> name="status" value="1">终稿</label>
          <label>
            <input type="radio" <eq name="res.status" value="0">checked</eq> name="status" value="0">草稿</label>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>内容分组：</label>
        </dt>
        <dd>
          <volist name="grouplist" id="grouplist">
            <label>
              <input type="checkbox" name="group_name_collection[]" value="{$grouplist.name}" <if condition="in_array($grouplist['name'],$articlegroup)">checked</if>/>{$grouplist.name} &nbsp;&nbsp;</label>
          </volist>
        </dd>
      </dl>
      <dl class="kv J_smore" style="display:none;">
        <dt>
          <label>爱吧网文章展示设定：</label>
        </dt>
        <dd>
          <label>
            <input type="checkbox" name="is_index_news[]" value="A01" <if condition="in_array('A01',$isindexnews)">checked</if>/>首页头条文字置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="A02" <if condition="in_array('A02',$isindexnews)">checked</if>/>首页头条文字列表 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="A03" <if condition="in_array('A03',$isindexnews)">checked</if>/>首页头条图片置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="A04" <if condition="in_array('A04',$isindexnews)">checked</if>/>首页版块文字置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="A05" <if condition="in_array('A05',$isindexnews)">checked</if>/>首页版块图片置顶 &nbsp;&nbsp;</label>
        </dd>
        <dd>  
          <label>
            <input type="checkbox" name="is_index_news[]" value="A06" <if condition="in_array('A06',$isindexnews)">checked</if>/>首页版块栏目显示列表 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="B01" <if condition="in_array('B01',$isindexnews)">checked</if>/>频道头条文字置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="B02" <if condition="in_array('B02',$isindexnews)">checked</if>/>频道头条文字列表 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="B03" <if condition="in_array('B03',$isindexnews)">checked</if>/>频道头条图片置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="B04" <if condition="in_array('B04',$isindexnews)">checked</if>/>频道版块文字置顶 &nbsp;&nbsp;</label>
        </dd>  
        <dd>  
          <label>
            <input type="checkbox" name="is_index_news[]" value="B05" <if condition="in_array('B05',$isindexnews)">checked</if>/>频道版块图片置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="B06" <if condition="in_array('B06',$isindexnews)">checked</if>/>小编推荐 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="C01" <if condition="in_array('C01',$isindexnews)">checked</if>/>内容页热点文字置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="C02" <if condition="in_array('C02',$isindexnews)">checked</if>/>内容页热点图片置顶 &nbsp;&nbsp;</label>
          <label>
            <input type="checkbox" name="is_index_news[]" value="D01" <if condition="in_array('D01',$isindexnews)">checked</if>/>首页至IN话题 &nbsp;&nbsp;</label>
        </dd>
      </dl>
      <div class="actions">
        <if condition="isset($res['id'])">
          <input class="btn btn-y" type="submit" value="修改" />
          <else/>
          <input class="btn btn-y" type="submit" value="添加" />
        </if>

        <if condition="empty($callback)">
          <input class="btn btn-n" type="button" value="取消" onclick="history.go(-1);" />
          <elseif condition="$callback['back'] === 'block'" />
          <input class="btn btn-n" type="button" value="取消" onclick="history.go(-1);" />
          <elseif condition="$callback['back'] === 'recycle'" />
          <input class="btn btn-n" type="button" value="取消" onclick="history.go(-1);" />
        </if>
      </div>
      </form>
    </div>

  </div>
</body>

</html>